import pandas as pd


def update_none(frame: pd.DataFrame):
    # frame.fillna(value,method,inplace,limit)
    # 参数一：value，也可以是一个字典值(需要替换的列和值)
    frame.fillna({"age": "小美丽", "height": "大美丽"})
    # 参数二：method 插值方法，如果没有其他参数，默认ffill
    # 参数三：limit 填充的个数
    frame.fillna(method='ffill', inplace=True)
    print(frame)


if __name__ == '__main__':
    data = {"name": {"one": "小明", "two": "小红", "three": "小蓝"},
            "age": {"one": 18, "two": None, "three": 20},
            "height": {"one": 188, "two": 189, "three": None}
            }
    frame = pd.DataFrame(data)
    update_none(frame)
